/**
 * Created by zhangqingxi on 2017-04-06.
 */
var modelPath=ROOT_PATH+'/environmental/monitor/instrument/';


//初始化部门
function initDept() {

    $('#deptId').combotree({
        url: ROOT_PATH+'/permission/department/getDepartmentTree.shtml?parentId=0',
        required:true,
        editable:false,
        prompt:'请选择'
    });
}

//初始化异常状态
function initUseState() {
    $('#useState').combobox({
        data:[{"id":0,"text":"未使用"},{"id":1,"text":"使用"}],
        valueField:'id',
        textField:'text',
        panelHeight:'auto',
        editable:false,
        required:true
    });
}
//计算价格
function calculationTotal() {
    var countNum=$('#count').numberspinner('getValue');
    var priceNum=$('#price').numberspinner('getValue');
    var totalNum=countNum*priceNum;
    $('#total').numberbox('setValue',totalNum);
}
//初始化计算
function initCalculation() {
    $('#count').numberspinner({
        onChange:function (newValue, oldValue) {
            calculationTotal();
        }
    });

    $('#price').numberspinner({
        onChange:function (newValue, oldValue) {
            calculationTotal();
        }
    });

}